<template>
  <svg aria-hidden="true" :style="{ width, height }">
    <use :xlink:href="symbolId" :fill="color" />
  </svg>
</template>

<script setup lang="ts">
import { computed } from 'vue'
interface Props {
  name: string
  prefix?: string
  color?: string
  width?: string
  height?: string
}
const props = withDefaults(defineProps<Props>(), {
  prefix: 'icon',
  color: '#333',
  width: '16px',
  height: '16px',
})
const symbolId = computed(() => `#${props.prefix}-${props.name}`)
</script>
